package avicit.cbb.techclass.elefileupdown.service;

import avicit.platform6.modules.system.sysfileupload.domain.SysFileUpload;

import java.sql.Blob;
import java.util.List;
import java.util.Map;


/**
 * <p>金航数码科技有限责任公司</p>
 * <p>作者：孟飞</p>
 * <p>邮箱：mengf@avicit.com</p>
 * <p>创建时间： 2014-10-21 上午9:05:52 </p>
 * <p>类说明：附件查询、查询接口</p>
 * <p>修改记录： </p>
 */
public interface FileUploadService {

	/**
	 * 获取已上传附件列表
	 * @author 钟一华
	 * @param formid
	 * @param allowDel
	 * @param mongoId
	 * @param param
	 * @return Map<String,String>
	 * @throws
	 */
	public Map<String, String> getAttachHtml(String formid, String allowDel, String mongoId, Map<String, Object> param);

	/**
	 * 按id删除附件表
	 * @author 孟飞 
	 * @param attachId void
	 * @throws
	 */
	public void deleteAttachById(String attachId);

	/**
	 * 删除formId下的所有附件
	 * @author 孟飞 
	 * @param formId void
	 * @throws
	 */
	public void deleteAttachByFormId(String formId);

	/**
	 * 根据id获得附件名称
	 * @author 孟飞 
	 * @param pkId
	 * @return String
	 * @throws
	 */
	public String getFileNameById(String pkId);

	/**
	 * 获取文件内容
	 * @author 孟飞 
	 * @param condition
	 * @return Blob
	 * @throws
	 */
	public Blob getFileBodyByCondition(Map<String, String> condition);

	/**
	 * 编辑页面html
	 * @param formId
	 * @param saveType
	 * @param param
	 * @return
	 * @throws Exception Map<String,String>
	 * @throws
	 */
	public Map<String, String> getAttachViewHtml(String formId, String saveType, Map<String, Object> param) throws Exception;

	/**
	 * 详细页面html
	 * @param formId
	 * @param saveType
	 * @param param
	 * @return
	 * @throws Exception Map<String,String>
	 * @throws
	 */
	public Map<String, String> getAttachDetailHtmlByMultiMedia(String formid, String allowDel, String mongoId, Map<String, Object> param) throws Exception;
	
	/**
	 * 详细页面html
	 * @param formId
	 * @param saveType
	 * @param param
	 * @return
	 * @throws Exception Map<String,String>
	 * @throws
	 */
	public Map<String, String> getAttachDetailHtmlByDoc(String formid, String allowDel, String mongoId, Map<String, Object> param) throws Exception;
	
	/**
	 * 获取已上传附件列表(部门文件)
	 * @param formid
	 * @param allowDel
	 * @param mongoId
	 * @param param  userSecretLevel
	 * @return Map<String,String>
	 * @throws
	 */
	public Map<String, String>  getAttachHtmlByDoc(String formid, String allowDel, String mongoId, Map<String, Object> param);

	/**
	 * 按formid获取附件列表
	 * @author 孟飞 
	 * @param fileuploadBusinessId
	 * @return List<SysFileUpload>
	 * @throws
	 */
	public List<SysFileUpload> getFileListByFormId(String fileuploadBusinessId);

	/**
	 * 获取上传事件
	 * @return FileUploadEvent
	 * @throws
	 */
	public FileUploadEvent getAfterEvent();

	/**
	 * 按ID查找附件
	 * @author 孟飞 
	 * @param attachId
	 * @return SysFileUpload
	 * @throws
	 */
	public SysFileUpload getAttachById(String attachId);

	/***
	 * 根ids获取附件列表(原文查询中批量下载时应用，2015/08/11新增)
	 * @author 郭亮
	 * @param attachIds
	 * @return
	 */
	public List<SysFileUpload> getFileListByIds(String attachIds);

	/**
	 * 获取已上传附件列表(多媒体)
	 * @param formid
	 * @param allowDel
	 * @param mongoId
	 * @param param  userSecretLevel
	 * @return Map<String,String>
	 * @throws
	 */
	public Map<String, String> getAttachHtmlByMultiMedia(String formid, String allowDel, String mongoId, Map<String, Object> param);
	
	public String getUploadTypeHtml(Map<String, Object> param);

	public String getUploadTypeHtml();

	/**
	 * 修改上传类型
	 * @param param
	 * @param mongoId
	 * @throws Exception
	 */
	public void updateUploadType(Map<String, String> param, String mongoId) throws Exception;

	/**
	 * 修改附件描述
	 * @param param
	 * @param mongoId
	 * @throws Exception
	 */
	public void updateDescribe(Map<String, String> param, String mongoId) throws Exception;

	/**
	 * 获取转换后文件内容
	 * @author
	 * @param condition
	 * @return Blob
	 * @throws
	 */
	public Blob getSwfFileBodyByCondition(Map<String, String> condition);

	/**
	 * 获取转换后文件内容（fastdfs）
	 * @author
	 * @param condition
	 * @return byte []
	 * @throws
	 */
	public byte[] getConvertFileBodyByCondition(Map<String, String> condition);
	
	/**
	 * 根据数据id和附件id修改删除状态
	 * @param recordId
	 * @param attachId
	 * @return
	 * @throws Exception CbbDocRelation
	 * @throws
	 */
	public void updateDocRelationByRecordIdAttachIdForDelete(String recordId, String attachId, String status) throws Exception;
	
	/**
	 * 修改是否扫描件
	 */
	public void updateScanningCopy(Map<String, String> param, String mongoId) throws Exception;
	
	/**
	 * 修改稿本类型
	 */
	public void updateManuscript(Map<String, String> param, String mongoId) throws Exception;
	
	/**
	 * 修改附件名称
	 */
	public void updateAttachName(Map<String, String> param, String mongoId) throws Exception;
	
	/**
	* @Title: updateFjtmByTableId 
	* @Description:  修改附件题名字段
	* @param param 
	* @return void
	* @date 2020-05-12 
	* @author HuangJian
	*/
	public void updateFjtmByTableId(Map<String, String> param) throws Exception;
	/**
	 * 修改附件排序
	 */
	public void updateAttachOrder(Map<String, String> param, String mongoId) throws Exception;

	/**
	 * SanXiaFiles create by zhaoxiaolong 获取附件信息数据集合
	 * @param formId 条目ID
	 * @param ids 待下载ID串
	 * @return
	 */
	List<SysFileUpload> getFileListByFormIdAndIds(String formId, String ids);
}
